﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.CMS263.PO;
using Com.CMS263.DAO;

namespace Com.CMS263.BLL
{
    public class CategoryBLL:BaseBLL<Category>
    {
        CategoryDAO dao = new CategoryDAO();
        public Category entity = new Category();
        public override Category GetModel()
        {
            return entity;
        }
        public IList<Category> FindByParentId(int parentId)
        {
            return dao.FindByParentId(parentId);
        }
        /// <summary>
        /// 查询全部
        /// </summary>
        /// <returns></returns>
        public IList<Category> FindAll()
        {
            return dao.FindAll();
        }
        /// <summary>
        /// 模糊查询
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public int FindListByKey(string key)
        {
            return dao.FindListByKey(key);
        }
        /// <summary>
        /// 模糊查询，分页
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pagesize"></param>
        /// <param name="pageindex"></param>
        /// <returns></returns>
        public IList<Category> FindListByKey(string key, int pagesize, int pageindex)
        {
            return dao.FindListByKey(key,pagesize,pageindex);
        }
        /// <summary>
        /// 查父节点
        /// </summary>
        /// <returns></returns>
        public IList<Category> FindListPro()
        {
            return dao.FindListPro();
        }

        public Category FindModelByName(int parentId, string caName)
        {
            return dao.FindModelByName(parentId,caName);
        }
    }
}
